<template>
	<div>
		<div class="cover_c">
			<div class="cover">
				<img src="https://xxx.oss.com/dxdh/%E8%92%99%E7%89%88%E7%BB%84%201.png" alt=""
					style="width:100%;height:100%">
			</div>
		</div>
		<div class="content">
			<div class="fixed_box">
				<div class="box_title"><span style="color:red">终选方案</span>已选择</div>
				<div class="selected_number">{{selectnum}}</div>
				<div class="line_middle">/</div>
				<div class="total_number">{{volunteerNum}}</div>
			</div>
			<titles :subtitle='subtitle'></titles>
			<div class="pagetitle">
				<div>“最终”方案</div>
			</div>
			<div class="line"></div>
			<!-- <div class="explain">
                点击列表右边“专业填写”的 <i class="el-icon-arrow-right"></i> 修改你想要的专业。
            <div class="more">详细</div>
            </div>
            <div class="explain">按住鼠标并拖动可调换志愿顺序</div>
            <div class="prepare">
                &nbsp;&nbsp;您选择的“职业岗位”：<span class="preparedata">&nbsp;{{input.ProfessionalPost}}&nbsp;</span>，“专业方向”：<span class="preparedata">&nbsp;{{input.direction}}&nbsp;</span>，
                        “专业名称”：<span class="preparedata">&nbsp;{{input.name}}&nbsp;</span>，“院校性质”：<span class="preparedata">&nbsp;{{input.nature}}&nbsp;</span>，
                        “地理位置”：<span class="preparedata">&nbsp;{{input.position}}&nbsp;</span>
            </div> -->
			<div class="subjecttable" v-for="(item,index) in tabledata" :key="index">
				<div class="subtitle1">
					建议的第{{index+1}}志愿: <span class="status"
						v-bind:style='{color:color[index]}'>({{item[0].voluntaryNature}})</span>
					<span v-if="item[0].isBenchmark"
						style="color:rgba(255, 60, 60, 1);font-family:Noto Sans SC;font-size: 22px;position:relative;left:20px;top:2px">这是您的基准志愿</span>
				</div>
				<final :tableData='item' :tableIndex='index' :color='color[index]' @newData='getData' v-if="display">
				</final>
			</div>
			<div class="leftside">
				<div class="cndns-right-btn">
					<el-link @click="jumpTo('/informationfilling')" :underline="false">
						<i class="el-icon-s-home"></i>
						<div class="text">首页</div>
					</el-link>
				</div>
				<div class="cndns-right-btn">
					<!-- <el-tooltip class="item" effect="light" content="进入往年当量" hide-after="5000" placement="left-start"> -->
					<el-link @click="jumpTo('/Optimalscheme')" :underline="false">
						<i class="iconfont icon-shangyiye"></i>
						<div class="text">优选方案</div>
					</el-link>
					<!-- </el-tooltip> -->
				</div>
				<div class="cndns-right-btn">
					<!-- <el-tooltip class="item" effect="light" content="进入往年当量" hide-after="5000" placement="left-start"> -->
					<el-link @click="verifyVoluntary()" :underline="false">
						<i class="iconfont icon-baocun"></i>
						<div class="text">保存志愿</div>
					</el-link>
					<!-- </el-tooltip> -->
				</div>
				<div class="cndns-right-btn">
					<!-- <el-tooltip class="item" effect="light" content="进入往年当量" hide-after="5000" placement="left-start"> -->
					<el-link @click="download()" :underline="false">
						<i class="iconfont icon-xiazai-wenjianxiazai-12"></i>
						<div class="text">下载志愿</div>
					</el-link>
					<!-- </el-tooltip> -->
				</div>
				<div class="cndns-right-btn">
					<!-- <el-tooltip class="item" effect="light" content="进入往年当量" hide-after="5000" placement="left-start"> -->
					<el-link @click="dialogTableVisible = true" :underline="false">
						<i class="iconfont icon-guihua"></i>
						<div class="text"> 学业安排</div>
					</el-link>
					<!-- </el-tooltip> -->
				</div>
			</div>
			<!-- <div class="select">
				<!-- <el-button class="buttonleft" @click="jumpTo('/SubjectVoluntary')" >返回“优选”方案</el-button> -->
			<!-- <el-button class="buttonright" type="primary" @click="download()">保存、导出“终选”方案</el-button> -->
			<!-- <el-button class="left" @click="jumpTo('/Optimalscheme')" v-if="status">返回“优选”方案</el-button>
				<el-button class="middle" type="primary" @click="verifyVoluntary()">保存我的最终志愿</el-button>
				<el-button class="right" type="success" @click="download()">导出我的最终志愿表</el-button> -->
			<!-- <el-button class="right_plan" @click="dialogTableVisible = true">查看大学规划</el-button> -->
			<!-- </div> --> -->
		</div>
		<el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="680px" :show-close="false">
			<!-- <div class="message">
                <img src="../assets/error.png" alt="">
                <div style="margin-top:45px" v-if="messageFlag==0">您仅选择了{{calculate}}个志愿<br>您还可以选择{{volunteerNum-calculate}}个志愿</div>
                <div style="margin-top:45px" v-if="messageFlag==1">超出可选志愿数量</div>
                <div style="margin-top:45px" v-if="messageFlag==2">每个“专业填写”栏目中至少填写一个专业信息</div>
            </div>
            <div slot="footer" class="button" v-if="messageFlag==0">
                <el-button @click="handleDialogSelection(1)" class="dialogButtonLeft" >重新选择</el-button>
                <el-button @click="handleDialogSelection(2)" type="primary" class="dialogButtonRight">仍要继续</el-button>
            </div>
            <div slot="footer" class="button" v-if="messageFlag==1||messageFlag==2"> -->
			<!-- <el-button @click="dialogVisible=false" type="primary" class="dialogButtonMiddle" v-if="messageFlag==1">确定</el-button> -->
			<!-- <el-button @click="handleDialogSelection(1)" type="primary" class="dialogButtonMiddle">确定</el-button>
            </div> -->

			<div slot="title" class="dialogheader">
				志愿检测
			</div>
			<div v-loading="loadingFlag">
				<div class="subtitle">
					检测到你所填报的志愿中
				</div>
				<div v-if="benchmarkFlag" class="correctClass">您的"基准志愿"位置放置符合要求</div>
				<div v-if="!benchmarkFlag" class="errorClass">您的"基准志愿"设置不合理</div>
				<div v-if="gradientFlag" class="correctClass">您的"志愿梯度"设置符合上下浮动要求</div>
				<div v-if="!gradientFlag" class="errorClass">您的志愿梯度不合理,请进行优化</div>
				<div v-if="lastVolunteerFlag" class="correctClass">您的"最后志愿"位置放置符合要求</div>
				<div v-if="!lastVolunteerFlag" class="errorClass">您的"最后志愿"不合理,请进行优化</div>
				<div slot="footer" class="button">
					<el-button class="dialogButtonLeft" @click="dialogVisible=false" type="primary" v-if="!allCorrectFlag">返回修改</el-button>
					<el-button @click="save()"  class="dialogButtonRight" 
						v-if="!allCorrectFlag">依旧保存</el-button>
					<el-button type="primary" class="dialogButtonRight" @click="save()" v-if="allCorrectFlag">保存
					</el-button>
					<el-button class="dialogButtonLeft" @click="dialogVisible=false" v-if="allCorrectFlag">返回修改
					</el-button>
				</div>
			</div>
		</el-dialog>

		<el-dialog :visible.sync="dialogTableVisible" width="90%">
			<template slot="title">
				<div style="font-size: 25px;
			font-family: Noto Sans SC;font-weight: bold;">{{title}}</div>
			</template>
			<div class="tabletext">
				<el-table :data="gridData" border >
					<el-table-column property="ordernumber" label="序号" width="100"></el-table-column>
					<el-table-column property="matters" label="学业事宜" width="450" ></el-table-column>
					<el-table-column property="year" label="完成学年、学期" width="470"></el-table-column>
					<el-table-column property="way" label="帮助方式" ></el-table-column>
				</el-table>
			</div>
		</el-dialog>
	</div>

</template>

<script>
	import titles from '../components/Title'
	import final from '../components/FinalTable'
	import timeCalculate from '../common/timeCalculate'
	export default {
		components: {
			titles,
			final,
		},
		data() {
			return {
				subtitle: '我的"平行志愿方案"——专业志愿',
				newData: [],
				title: "四年大学怎么上 “大学导航”来帮忙",
				form: {
					fullName: "",
					subject: "",
					provinceId: "",
					school: "",
					qqNumber: "",
					password: "",
					identity: "",
					year: "",
					city: "",
					phoneNumberOrEmail: "",
					code: "",
				},
				calculate: 0,
				volunteerNum: '',
				status: "",
				tableData: [],
				tabledata: [],
				number: 0,
				color: [
					"#F3930C",
					"#894DFF",
					"#00B23C",
					"#FF5433",
					"#FC25D8",
					"#1A7EFF",
				],
				total: {},
				selectnum: "",
				display: false,
				finalData: [],
				dialogVisible: false,
				benchmarkFlag: Boolean,
				gradientFlag: Boolean,
				lastVolunteerFlag: Boolean,
				dialogTableVisible: false,
				allCorrectFlag: false,
				loadingFlag: false,
				messageFlag: 0,
				input: {
					ProfessionalPost: "",
					direction: "",
					name: "",
					nature: "",
					position: "",
				},
				excellName: '', //导出excell表名
				totaldata: {},
				gridData: [{
					ordernumber: '1',
					matters: '入党申请',
					year: '新生入党后第一学期',
					way: '辅导员'
				}, {
					ordernumber: '2',
					matters: '专业认知+转专业政策条件',
					year: '新生入党后第一学期',
					way: '院系专业教育+辅导员'
				}, {
					ordernumber: '3',
					matters: '奖、助学金政策、条件、要求',
					year: '第二、三、四学年（至少获一次一等奖、一次二等奖）',
					way: '自己努力+辅导员'
				}, {
					ordernumber: '4',
					matters: '热门选修课抢选',
					year: '相关学期',
					way: '登录教务系统'
				}, {
					ordernumber: '5',
					matters: '文体社团活动',
					year: '相关学期',
					way: '辅导员+学生会+团总支'
				}, {
					ordernumber: '6',
					matters: '相关技能等级证书',
					year: '相关学年、相关学期',
					way: '院系+专业老师'
				}, {
					ordernumber: '7',
					matters: '相关职业资格证书',
					year: '相关学年、相关学期',
					way: '院系+专业老师'
				}, {
					ordernumber: '8',
					matters: '大学英语四级考试',
					year: '第一学年第二学期',
					way: '英语老师+学哥学姐'
				}, {
					ordernumber: '9',
					matters: '大学英语六级考试',
					year: '第二学年第二学期',
					way: '英语老师+学哥学姐'
				}, {
					ordernumber: '10',
					matters: '国内社会实践，国（境）外换学、游学',
					year: '相关学年、相关学期、假期',
					way: '院系+辅导员'
				}, {
					ordernumber: '11',
					matters: '国内研究生招生政策、报名要求、考试课程等',
					year: '第二学年第二学期',
					way: '院系+专业老师+学哥学姐'
				}, {
					ordernumber: '12',
					matters: '国内研究生保送政策、条件',
					year: '新第二学年第二学期',
					way: '院系+专业老师+学哥学姐'
				}, {
					ordernumber: '13',
					matters: '国（境）外留学政策、申请条件、备考要求等',
					year: '第二学年第二学期',
					way: '自己+学哥学姐+中介机构'
				}, {
					ordernumber: '14',
					matters: '国外研究生保送政策、条件',
					year: '第二学年第二学期',
					way: '自己+学哥学姐+中介机构'
				}, {
					ordernumber: '15',
					matters: '国内研究生考试课程学习、报名、考试',
					year: '第三学年---第四学年第一学期',
					way: '自己+学哥学姐'
				}, {
					ordernumber: '16',
					matters: '国（境）外留学雅思或托福学习、考试，选校、申请',
					year: '第三学年---第四学年第一学期',
					way: '自己+学哥学姐+中介机构'
				}, {
					ordernumber: '17',
					matters: '国内研究生复试',
					year: '第四学年第二学期',
					way: '所报高校导师'
				}, {
					ordernumber: '18',
					matters: '国（境）外留学签证',
					year: '第四学年第二学期',
					way: '大使（领事）馆'
				}, {
					ordernumber: '19',
					matters: '毕业设计、毕业论文、毕业答辩',
					year: '第四学年第二学期',
					way: '指导老师'
				}, {
					ordernumber: '20',
					matters: '坚决不能挂科',
					year: '每一学期',
					way: '自己努力+老师指导'
				}]
			}
		},
		methods: {
			jumpTo(router) {
				this.$router.push(router)
			},
			preparedata() {
				let preparafrom = JSON.parse(sessionStorage.preparafrom)
				// console.log(preparafrom)
				if (preparafrom != 0) {
					this.input.ProfessionalPost = preparafrom.jobName
					this.input.direction = preparafrom.proDirection
					this.input.name = preparafrom.proName
					this.input.nature = preparafrom.schoolNature
					this.input.position = preparafrom.schoolLocation
				}
			},
			getData(data) {
				console.log(data)
				if (data[0].collegeName != null) {
					data.forEach(e => {
						this.newData.push(e)

					})
				}
			},
			jumpTo(router) {
				sessionStorage.setItem('status', JSON.stringify(1))
				this.$router.push(router)
			},
			getTableData() {
				this.tableData = []
				this.tableData = JSON.parse(sessionStorage.preferredtable)
				let number = 0
				this.tableData.forEach(e => {
					if (Object.keys(this.total).indexOf('' + e.volunteerGroup) === -1) {
						this.total[e.volunteerGroup] = []
					}
					this.total[e.volunteerGroup].push(e)
					if (e.volunteerGroup > number) {
						number = e.volunteerGroup
					}
				})
				this.number = number
				// console.log(this.total);
				//创建符合组件FinalchemeTable.vue浏览的数组
				for (let j = 0; j <= this.number - 1; j++) {
					if (this.total[j + 1] == undefined || this.total[j + 1] == null) {
						this.total[j + 1] = []
						this.total[j + 1][0] = {
							'actualEnrollment': null,
							'collegeCode': null,
							'collegeName': null,
							'controlLine': null,
							'id': null,
							'introduction': null,
							'isBenchmark': null,
							'minCastScore': null,
							'minScoreDifference': null,
							'ordernumber': null,
							'planEnrollment': null,
							'voluntaryNature': null,
							'volunteerGroup': j + 1
						}
					}
					this.tabledata.push(this.total[j + 1])
				}
				// console.log(this.tabledata)
				// console.log(this.totalData);
				//创建表格颜色数组
				if (this.number > 6) {
					for (let i = 0; i < this.number - 6; i++) {
						this.color.push(this.color[i])
					}
				}
				// console.log(this.tableData.length);
				this.display = true
				this.selectnum = this.tableData.length
			},
			//转换成接口所需参数数组格式
			changeFinalData() {
				this.finalData = []
				this.newData.map((item, index) => {
					// console.log(item);
					if (item.collegeName != null) {
						this.finalData.push(
							Object.assign({
								collegeName: item.collegeName,
								collegeCode: String(item.collegeCode),
								professional: item.professional,
								serialNumber: index + 1,
								actualEnrollment: item.actualEnrollment,
								controlLine: item.controlLine,
								isBenchmark: item.isBenchmark,
								introduction: "www.baidu.com",
								minScoreDifference: item.minScoreDifference,
								minCastScore: item.minCastScore,
								planEnrollment: item.planEnrollment,
								ranking: item.ranking,
								username: JSON.parse(sessionStorage.username),
								voluntaryNature: item.voluntaryNature,
								volunteerGroup: item.volunteerGroup,
								professionalGroupCode: item.professionalGroupCode,
								professionalGroup: item.professionalGroup,
							})
						)
					}

					// console.log(this.finalData);
				})
			},
			//保存志愿
			save() {
				// console.log('保存志愿')
				this.loadingFlag = true
				this.changeFinalData()
				// console.log(this.finalData);
				sessionStorage.setItem('isFilling', 1)
				let data = this.finalData
				let provinceId = sessionStorage.provinceId

				this.$axios({
						method: 'post',
						url: `${this.baseURL}/voluntaryFilling/saveVoluntaryTable?provinceId=${provinceId}`,
						data: data
					})
					.then(res => {
						if (res.data.status == 200) {
							// console.log('???');
							this.$notify({
								title: '成功',
								message: res.data.data,
								type: 'success'
							});
							this.loadingFlag = false
							this.dialogVisible = false
							// sessionStorage.setItem('fromSelect', 0)
						}
					})
					.catch(err => {
						this.$notify({
							title: '失败',
							message: err,
							type: 'error'
						});
						this.loadingFlag = false
						this.dialogVisible = false
					})
			},
			//导出志愿表
			download() {
				this.changeFinalData()
				this.finalData[0].filename = this.excellName
				// console.log(this.finalData[0])
				let form = JSON.parse(sessionStorage.form)
				let volunteerNumber = sessionStorage.volunteerNumber
				this.$axios({
						url: `${this.baseURL}/voluntaryFilling/downloadVoluntaryTable?professionNum=${this.finalData[0].professional.length}`,
						method: 'post',
						data: this.finalData,
						//接受blob流文件需设置responseType为blob
						responseType: 'blob',
					})
					.then(response => {
						console.log(response.data);
						const link = document.createElement('a'); //创建下载标签
						let blob = new Blob([response.data], {
							type: 'application/vnd.ms-excel'
						});
						link.style.display = 'none';
						link.href = URL.createObjectURL(blob); //创建url对象
						link.download = this.excellName+"最终参考方案" + ".xlsx"; //下载后文件名
						console.log(this.excellName)
						document.body.appendChild(link);
						link.click(); //开始下载
						document.body.removeChild(link);
						URL.revokeObjectURL(link.href); //销毁url对象
					})
			},

			//检测志愿合理性
			verifyVoluntary() {
				this.allCorrectFlag = false
				this.changeFinalData()
				// console.log(this.finalData);
				let benchMarkPos
				this.finalData.forEach((e, index) => {
					if (e.isBenchmark == 1) {
						benchMarkPos = index + 1
					}
				})
				// console.log(benchMarkPos);
				let postUrl = ""
				if (benchMarkPos) {
					postUrl =
						`${this.baseURL}/voluntaryFilling/checkVoluntaryRationality?benchmarkVolunteerPos=${benchMarkPos}`
					// console.log("1");
				} else {
					postUrl = `${this.baseURL}/voluntaryFilling/checkVoluntaryRationality?benchmarkVolunteerPos=2`
					// console.log("2");
				}
				this.$axios.post(postUrl, this.finalData)
					.then(res => {
						let response = res.data.data
						this.benchmarkFlag = response.is_benchmarkVolunteer
						this.lastVolunteerFlag = response.is_ensure
						//新高考不验证梯度,判断是否为新高考
						let trans_form = JSON.parse(sessionStorage.trans_form)
						if (trans_form.batches == '新高考') {
							if (this.benchmarkFlag && this.lastVolunteerFlag) {
								this.allCorrectFlag = true
							}
						} else {
							this.gradientFlag = response.is_gradient
							// console.log(response.is_gradient);
							// console.log(this.gradientFlag);
							if (this.benchmarkFlag && this.lastVolunteerFlag && this.gradientFlag) {
								this.allCorrectFlag = true
							}
						}
						// console.log(this.allCorrectFlag);
						// console.log(res.data);
						this.dialogVisible = true
					})
			},
			//对象数组排序函数
			compare(property) {
				return function(a, b) {
					var value1 = a[property];
					var value2 = b[property];
					return value1 - value2;
				}
			},
			//登录用户从后端查找已保存的志愿
			backgetTableData() {
				//从后台查数据，将查到的数据渲染到缓存里面去
				let formData = JSON.parse(sessionStorage.form)
				let Batch = (formData.batch).toString()
				let Subject = (formData.subject).toString()
				let username = JSON.parse(sessionStorage.username)
				let provinceId = JSON.parse(sessionStorage.provinceId)
				this.$axios.get(
					`${this.baseURL}/chooseVolunteer/getFselection?username=${username}&provinceId=${provinceId}&batch=${Batch}&score=${formData.score}&subject=${Subject}&referenceYear=${formData.year}`
				).then(res => {
					// console.log(res.data)
					let getData = res.data.data
					getData.map((item, index) => {
						this.tableData.push(
							Object.assign(item, {
								ordernumber: index + 1
							})
						)
					})
					//根据professionalNumber对专业进行排序
					for (let i = 0; i <= this.tableData.length - 1; i++) {
						// console.log(this.tableData[i].professional);
						this.tableData[i].professional.sort(this.compare('professionalNumber'))
						this.dataIndex = i;
						// console.log(this.dataIndex)
					}
					let number = 0
					this.tableData.forEach(e => {
						if (Object.keys(this.total).indexOf('' + e.volunteerGroup) === -1) {
							this.total[e.volunteerGroup] = []
						}
						this.total[e.volunteerGroup].push(e)
						if (e.volunteerGroup > number) {
							number = e.volunteerGroup
						}
					})
					this.number = number
					// console.log(this.total);
					//创建符合组件SubjectTable.vue浏览的数组
					for (let j = 0; j <= this.number - 1; j++) {
						if (this.total[j + 1] == undefined || this.total[j + 1] == null) {
							this.total[j + 1] = []
							this.total[j + 1][0] = {
								'actualEnrollment': null,
								'collegeCode': null,
								'collegeName': null,
								'controlLine': null,
								'id': null,
								'introduction': null,
								'isBenchmark': null,
								'minCastScore': null,
								'minScoreDifference': null,
								'ordernumber': null,
								'planEnrollment': null,
								'voluntaryNature': null,
								'volunteerGroup': j + 1
							}
						}
						this.tabledata.push(this.total[j + 1])
					}
					// console.log(this.tabledata)
					// console.log(this.totalData);
					//创建表格颜色数组
					if (this.number > 6) {
						for (let i = 0; i < this.number - 6; i++) {
							this.color.push(this.color[i])
						}
					}

					// this.tableData=res.data.data
					sessionStorage.setItem('preferredtable', JSON.stringify(this.tableData))
					this.selectnum = JSON.parse(sessionStorage.preferredtable).length
					this.display = true
				})
			},
			//导出的“终选”方案文件名：省份+年份+科类+批次+姓名+分数+分差+排名
			excellname() {
				let username = JSON.parse(sessionStorage.username)
				this.$axios.get(`${this.baseURL}/information/queryUserInfoByID?username=${username}`).then(res => {
					this.form = res.data.data
					console.log(this.form);
					let fullname = this.form.data.fullName
					let nameTable1 = JSON.parse(sessionStorage.trans_form)
					let nameTable2 = JSON.parse(sessionStorage.equivalent)
					let provinceN = nameTable1.province; //省份
					let yearN = nameTable1.year; //年份
					let subjectN = nameTable1.subject; //科类
					let batchesN = nameTable1.batches; //批次
					let scoreN = nameTable1.score; //分数
					let pointsDifferenceN = nameTable2.pointsDifference; //分差
					let rankingN = nameTable2.ranking; //排名
					this.excellName = provinceN + yearN + '年' + subjectN + batchesN + scoreN + '分' + fullname;
					console.log(this.excellName);
				})
			},
			//获取分数相当量
			getEquivalent() {
				// let username = JSON.parse(sessionStorage.username)
				// this.$axios.post(`${this.baseURL}/equivalent/myEquivalent?username=${username}`).then(res => {
				// 	this.lastData = res.data.data
				// console.log(this.lastData);
				this.lastData = JSON.parse(sessionStorage.equivalent)
				//请求平行志愿函数放入此成功回调，解决异步问题
				this.getParallelVolunteer()
				// })
			},
			//获取平行志愿组
			getParallelVolunteer() {
				let year = timeCalculate.timeCalculate() - 1
				let username = JSON.parse(sessionStorage.username)
				let formData = JSON.parse(sessionStorage.form)
				this.$axios({
						method: 'post',
						url: `${this.baseURL}/parallelVolunteering/getMyParallelVolunteeringFirstTime`,
						data: {
							batch: formData.batch,
							equivalentScore: this.lastData.score,
							provinceId: formData.provinceId,
							subject: formData.subject,
							username: username,
							year: year
						}
					})
					.then(res => {
						// console.log(res.data)
						let total = res.data.data;
						let number = 0
						let form = JSON.parse(sessionStorage.form)
						total.forEach(e => {
							if (Object.keys(this.totaldata).indexOf('' + e.volunteerGroup) === -1) {
								this.totaldata[e.volunteerGroup] = []
							}
							this.totaldata[e.volunteerGroup].push(e)
							if (e.volunteerGroup > number) {
								number = e.volunteerGroup
							}
						})
						// this.volunteerNum = number
						this.volunteerNum = JSON.parse(sessionStorage.denominator) //此处按要求分母与海选一致（具体待定）

						// sessionStorage.setItem('denominator',JSON.stringify(number))
						sessionStorage.setItem('denominator', JSON.stringify(this.volunteerNum))
					})
			}
		},
		created() {
			// console.log(sessionStorage.Optimalselect)
			this.excellname() //导出“终选”方案文件名
			this.status = JSON.parse(sessionStorage.finaltable)
			if (sessionStorage.Optimalselect == 1) {
				// console.log('缓存')
				this.getTableData()
			} else {
				this.backgetTableData()
			}
			this.getEquivalent()
			if (JSON.parse(sessionStorage.preferredtable)) {
				this.selectnum = JSON.parse(sessionStorage.preferredtable).length
			}
			// this.getParallelVolunteer()
			let denominator = JSON.parse(sessionStorage.denominator)
			this.volunteerNum = denominator
			this.input.ProfessionalPost = "";
			this.input.direction = "";
			this.input.name = "";
			this.input.nature = "";
			this.input.position = "";
			this.preparedata() //填报准备页面的数据


		}
	}
</script>
<style scoped>
	.content {
		width: 1650px;
		min-height: 1100px;
		background-color: #fff;
		margin: 100px auto;
		margin-bottom: 24px;
		position: relative;
		z-index: 1;
	}

	.explain {
		font-size: 22px;
		font-family: Source Han Sans;
		font-weight: 400;
		line-height: 41px;
		color: rgba(0, 0, 0, 0.45);
		width: 580px;
		/* height: 41px; */
		margin-left: 104px;
		margin-top: 24px;
		text-align: left;

	}

	.more {
		float: right;
		color: rgba(51, 170, 255, 1);
		cursor: pointer;
		/* position:relative;
    top:5px */
	}

	.subjecttable {
		width: 1580px;
		margin: 0 auto;
		margin-top: 30px;
	}

	.subtitle1 {
		font-size: 24px;
		font-family: Noto Sans SC;
		font-weight: 500;
		line-height: 48px;
		color: #000000;
		text-align: left;
		margin-bottom: 30px;
	}

	.select {
		width: 1200px;
		/* margin-bottom: 70px; */
		left: 0;
		right: 0;
		bottom: 0;
		position: fixed;
		margin: auto;
		z-index: 2;
		/* height: 150px; */
	}

	.line_middle {
		width: 101px;
		height: 86px;
		position: absolute;
		left: 75px;
		top: 70px;
		font-family: Noto Sans SC;
		font-size: 78px;
		line-height: 95px;

	}

	.select .left {
		width: 347px;
		height: 62px;
		color: rgba(51, 170, 255, 1);
		float: left;
		font-size: 24px;
		font-family: Source Han Sans;
		font-weight: 100;
		line-height: 41px;
		border: 2px solid #33AAFF;
		border-radius: 10px;
	}

	.select .right {
		width: 347px;
		height: 62px;
		float: right;
		font-size: 24px;
		font-family: Source Han Sans;
		font-weight: 100;
		line-height: 41px;
		border-radius: 10px;
	}

	.select .middle {
		width: 347px;
		height: 62px;
		margin: 0 auto;
		font-size: 24px;
		font-family: Source Han Sans;
		font-weight: 100;
		line-height: 41px;
		border-radius: 10px;
	}

	.select .right_plan {
		width: 347px;
		height: 62px;
		margin: 0 auto;
		font-size: 24px;
		font-family: Source Han Sans;
		font-weight: 100;
		line-height: 41px;
		border-radius: 10px;
		/* float: right; */
		color: #33AAFF;
		cursor: pointer;
		margin-top: 17px;
		border: none;
	}

	.cover {
		position: absolute;
		top: -210px;
		z-index: 0;
		/* width: 100%; */
		height: 276px;
		/* text-align: center; */
		left: 50%;
		margin-left: -960px;
		overflow: hidden;
	}

	.cover_c {
		position: relative;
		width: 100%;
		/* z-index: 0; */
	}

	.button {
		width: 550px;
		height: 62px;
		border-radius: 10px;
		margin: 0 auto;
		margin-top: 40px;
		display: flex;
		flex-direction: row;

	}

	.dialogButtonLeft {
		width: 270px;
		height: 50px;
		border-radius: 10px;
		font-family: Noto Sans SC;
		font-size: 20px;
		font-weight: 300;
		margin-right: 56px;
		border: 1px solid #33AAFF;
		/* color: rgba(51, 170, 255, 1); */
		float: left;

	}

	.dialogButtonRight {
		width: 270px;
		height: 50px;
		border-radius: 10px;
		font-family: Noto Sans SC;
		font-size: 20px;
		font-weight: 300;
		float: right;
	}

	.dialogButtonMiddle {
		width: 270px;
		height: 50px;
		border-radius: 10px;
		font-family: Noto Sans SC;
		font-size: 20px;
		font-weight: 300;
		margin: 0 auto
	}

	.dialogheader {
		font-family: Noto Sans SC;
		font-size: 26px;
		font-weight: 400;
		color: black;
	}

	.subtitle {
		font-family: Noto Sans SC;
		font-size: 19px;
		font-weight: 400;
		text-align: left;
		color: black;
		padding-left: 50px;
		margin-bottom: 30px;
	}

	.correctClass {
		font-family: Noto Sans SC;
		font-size: 19px;
		font-weight: 400;
		text-align: left;
		color: rgba(51, 170, 255, 1);
		padding-left: 50px;
		margin-top: 10px;
	}

	.errorClass {
		font-family: Noto Sans SC;
		font-size: 19px;
		font-weight: 400;
		text-align: left;
		color: rgba(255, 51, 51, 1);
		padding-left: 50px;
		margin-top: 10px;
	}
	.content>>>.title {
		height: 10px !important;
	}
	
	.content>>>.student {
		text-align: center !important;
	}
	
	.line {
		width: 100%;
		height: 140px;
		font-size: 40px;
		font-family: Noto Sans SC;
		color: #000000;
		font-weight: 600;
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-left: 50px;
		justify-content: center;
	}
	
	.pagetitle {
		width: 100%;
		height: 120px;
		font-size: 40px;
		position: absolute;
		font-family: Noto Sans SC;
		margin-bottom: 0%;
		/* line-height: 71px; */
		color: #000000;
		/* margin: 0 auto; */
		font-weight: 700;
		/* margin-top: 80px; */
		letter-spacing: 2px;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.fixed_box {
		width: 250px;
		height: 200px;
		position: fixed;
		background-color: rgba(242, 250, 255, 1);
		box-shadow: 10px 10px 16px rgba(0, 0, 0, 0.16);
		border-radius: 16px;
		/* top: 550px; */
		bottom: 0;
		right: 0;
		z-index: 2;
	}

	.box_title {
		height: 28px;
		font-size: 28px;
		font-family: Noto Sans SC;
		font-weight: bold;
		line-height: 48px;
		position: absolute;
		top: 16px;
		left: 16px;
	}

	.selected_number {
		width: 80px;
		height: 56px;
		font-size: 55px;
		font-family: Noto Sans SC;
		font-weight: 400;
		line-height: 95px;
		color: #FF3333;
		position: absolute;
		top: 55px;
		left: 30px;
		text-align: right;
	}

	.total_number {
		width: 150px;
		height: 72px;
		font-size: 72px;
		font-family: Noto Sans SC;
		font-weight: 400;
		line-height: 122px;
		position: absolute;
		left: 100px;
		top: 80px;
	}

	.message {
		display: flex;
		flex-direction: column;
		width: 280px;
		margin: 0 auto;
		margin-top: 15px;
		margin-bottom: 20px;
		justify-content: center;
		align-items: center;
		font-size: 24px;
		font-family: Noto Sans SC;
		font-weight: 400;
		line-height: 41px;
		color: rgba(0, 0, 0, 0.45);
	}

	.prepare {
		color: rgba(0, 0, 0, 0.45);
		font-weight: 400;
		font-size: 0.114583rem;
		margin-top: 0.125rem;
		text-align: left;
		margin-left: 0.541667rem;
		width: 7.910417rem;
		/* text-indent:2em */
	}

	.preparedata {
		color: #39aaff;
		font-size: 25px;
	}

	.leftside {
		position: fixed;
		right: 1%;
		width: 85px;
		min-height: 48px;
		height: 400px;
		top: 33%;
		z-index: 100;
		box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
		border-radius: 40px;
		/* border: 10px solid black; */
		box-sizing: border-box;
		background: #fff;

	}

	.cndns-right-btn {
		border-radius: 40px;
		width: 100%;
		height: 16%;
		/* text-align: center; */
		display: block;
		margin-top: 10px;

		background-color: #fff;
	}

	i {
		font-size: 28px;
	}

	.text {
		font-size: 20px;
		font-family: Source Han Sans;
		font-weight: bold;
	}

	.tabletext>>>.el-table .cell {
		font-size: 23px !important;
		line-height:40px!important;
	}
</style>
